#include "blockqueue.hpp"
#include "task.hpp"

int main()
{
    srand(time(nullptr) * getpid() * 1234);
    blockqueue<task> qt;
    pthread_t p1;
    pthread_t p2;
    pthread_t p3;
    pthread_t c1;
    pthread_t c2;

    pthread_create(&p1, nullptr, product_task, (void*)&qt);
    pthread_create(&p2, nullptr, product_task, (void*)&qt);
    pthread_create(&p3, nullptr, product_task, (void*)&qt);
    pthread_create(&c1, nullptr, consume_task, (void*)&qt);
    pthread_create(&c2, nullptr, consume_task, (void*)&qt);

    while(true){}
    pthread_join(p1, nullptr);
    pthread_join(p2, nullptr);
    pthread_join(p3, nullptr);
    pthread_join(c1, nullptr);
    pthread_join(c2, nullptr);

    return 0;
}